/*
 * @lc app=leetcode.cn id=1822 lang=typescript
 *
 * [1822] 数组元素积的符号
 */

// @lc code=start
function arraySign(nums: number[]): number {
    let temp: number = 1;
    for (let i = 0; i < nums.length; i++) {
        const element = nums[i];
        if (element === 0) {
            return 0;
        } else {
            temp = Math.sign(element) * temp;
        }
    }
    return temp!;
}
// @lc code=end
